from api.ihrm_login import login_Api
from common.ihrm_assert import common_assert


class Test_login:
    def test01_login_success(self):
        req_data = {"mobile": "13800000002", "password": "hm#qd@23!"}
        resp = login_Api.login(req_data)
        print(resp.json())   # 查看响应结果
        common_assert(resp, 200, 10000, True, '登录成功')
    #
    def test02_user_null(self):
        req_data = {"mobile": None, "password": "hm#qd@23!"}
        resp = login_Api.login(req_data)
        common_assert(resp, 200, 10000, False, '用户名或密码不能为空')

    def test03_pwd_null(self):
        req_data = {"mobile": "13800000002", "password": None}
        resp = login_Api.login(req_data)
        common_assert(resp, 200, 10000, False, '用户名或密码不能为空')

    def test04_10_moblie(self):
        req_data = {"mobile": "1380000002", "password": "hm#qd@23!"}
        resp = login_Api.login(req_data)
        common_assert(resp, 200, 10000, False, '用户名或密码错误')
    #
